package com.zr.model;
// Generated 2017-7-6 10:10:11 by Hibernate Tools 4.0.0.Final

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Cdriver generated by hbm2java
 */
@Entity
@Table(name = "cdriver", catalog = "cqlwlps")
public class Cdriver implements java.io.Serializable {

	private Integer did;
	private Cdstate cdstate;
	private String dname;
	private String dtel;
	private Set<Creceipt> creceipts = new HashSet<Creceipt>(0);
	private Set<Ccarreport> ccarreportsForDid2 = new HashSet<Ccarreport>(0);
	private Set<Ccarreport> ccarreportsForDid1 = new HashSet<Ccarreport>(0);

	public Cdriver() {
	}

	public Cdriver(String dname) {
		this.dname = dname;
	}

	public Cdriver(Cdstate cdstate, String dname, String dtel, Set<Creceipt> creceipts,
			Set<Ccarreport> ccarreportsForDid2, Set<Ccarreport> ccarreportsForDid1) {
		this.cdstate = cdstate;
		this.dname = dname;
		this.dtel = dtel;
		this.creceipts = creceipts;
		this.ccarreportsForDid2 = ccarreportsForDid2;
		this.ccarreportsForDid1 = ccarreportsForDid1;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)

	@Column(name = "did", unique = true, nullable = false)
	public Integer getDid() {
		return this.did;
	}

	public void setDid(Integer did) {
		this.did = did;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "dstateid")
	public Cdstate getCdstate() {
		return this.cdstate;
	}

	public void setCdstate(Cdstate cdstate) {
		this.cdstate = cdstate;
	}

	@Column(name = "dname", nullable = false)
	public String getDname() {
		return this.dname;
	}

	public void setDname(String dname) {
		this.dname = dname;
	}

	@Column(name = "dtel")
	public String getDtel() {
		return this.dtel;
	}

	public void setDtel(String dtel) {
		this.dtel = dtel;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "cdriver")
	public Set<Creceipt> getCreceipts() {
		return this.creceipts;
	}

	public void setCreceipts(Set<Creceipt> creceipts) {
		this.creceipts = creceipts;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "cdriverByDid2")
	public Set<Ccarreport> getCcarreportsForDid2() {
		return this.ccarreportsForDid2;
	}

	public void setCcarreportsForDid2(Set<Ccarreport> ccarreportsForDid2) {
		this.ccarreportsForDid2 = ccarreportsForDid2;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "cdriverByDid1")
	public Set<Ccarreport> getCcarreportsForDid1() {
		return this.ccarreportsForDid1;
	}

	public void setCcarreportsForDid1(Set<Ccarreport> ccarreportsForDid1) {
		this.ccarreportsForDid1 = ccarreportsForDid1;
	}

}
